#include "instanceobj.h"
#include <qsciscintilla.h>
#include <QWidget>
#include <QMenu>
#include "TerminalPlugin.h"


extern std::function<QsciScintilla* (QWidget*)> s_getCurEdit;

InstanceObj::InstanceObj(QWidget* pNotepad, QMenu* pMenu, QString strFileName) :QObject(pNotepad), m_terminalObj(nullptr), m_isMenuInited(false)
{
	m_pNotepad = pNotepad;
	m_rootMenu = pMenu;
	m_pluginModulePath = strFileName;
}

InstanceObj::~InstanceObj()
{

}

void InstanceObj::init()
{

}

void InstanceObj::on_delayLoadMenu()
{
	if (!m_isMenuInited)
	{
		m_terminalObj = new TerminalPlugin(m_pNotepad, m_rootMenu, m_pluginModulePath, this);
		m_isMenuInited = true;
	}
}



